home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MPW_TOOL / TOOLS / TOOLS_WI / ICON_8 / TESTS / DIFFWRDS.ICN < prev    next >
Text File  |  1990-03-02  |  358b  |  16 lines

  1. #
  2. #          D I F F E R E N T   W O R D S
  3. #
  4.  
  5. #  This program lists all the different words in the input text.
  6. #  The definition of a "word" is naive.
  7.  
  8. procedure main()
  9.    letter := &lcase ++ &ucase
  10.    words := set()
  11.    while text := read() do
  12.       text ? while tab(upto(letter)) do
  13.          insert(words,tab(many(letter)))
  14.    every write(!sort(words))
  15. end
  16.